<!doctype html>
<html>
<head>
<title>Wontube</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="description" content="Wontube"/>
<meta name="keywords" content="Wontube,Video,Music"/>
<#include "/include/css.html">
<#include "/admin/include/css.html">
</head>
<body>
<#include "/macro/utils.ftl">
<div id="page">	
    <#include "/admin/include/header.ftl">	
    
	<div id="navigation-container">
				<div class="navigation-wrap">					
					 <div class="browse-path">
						<a href="#">Movies</a>&gt; 
                        <span class="show-box">All Categories<span class="movie-show-ico"></span></span>
                            <div class="show-block">
                            <dl class="move-show-block">
                            <dd class="move-show-block-left">
                            	<a href="${contextPath}/video/movie/category/new">New Releases</a>
                            	<a href="${contextPath}/video/movie/category/pop">Top Popular</a></dd>
                            <dd class="move-show-block-right">
                            	
                            </dd>
                            </dl>
                            </div>
					</div>                 
                   
                
                
                <div id="image-slide-box">
                	<div id="image-slide-content" class="slides-control">
                     	<#if huluItems??>
                    	<#assign items = huluItems.items>
                    	<#list items?chunk(5) as item_chunk>
                    		<ul>          						
							<#list item_chunk as item>
                    		<#assign name=item.title!''>
                    		<#assign duration=item.duration!''>
							<#assign description=item.description!''>
                    		<#assign pic=item.thumbnail!''>
                    		<#assign score=item.score!''>
                    		<#assign actors=item.actors!''>
                    		<#assign url = contextPath + "/video/movie/pop/" + item.id>
                			<#if item.bannerImgUrl??>
                				<#assign pic=item.bannerImgUrl>
                			</#if>
							<#if (item_index + 1) % 5 == 0>
								<li class="no-margin-right" >
								<#else>
								<li >
							</#if>
							<div class="show-details-box">
									<input id="movieId" name="movieId"  type="hidden" value="${item.id}" size="40"/>
									<input id="movieTitle" name="movieTitle"  type="hidden" value="<#if item.parentTitle??>${item.parentTitle}:${item.title}<#else>${item.title}</#if>" size="40"/>
	                        		<div class="show-details-title"><a href="${url}"><@fromatTitle item.parentTitle!'' item.title!'' 10 20 /></a></div>
	                        		<div class="hr"></div>
	                        		<p><@formatSeconds duration /> |${(item.publishTime?date) ! ""}</p>
	                        		<p class="show-details-content"><@fromatTitle '' description!'' 150 150 /></p>
	                        		<p class="show-details-content-des"><a href="${url}">View Detail</a></p>
                        	</div>
							<a href="javascript:" onclick="showDetail(this);"><img src="${pic}"  alt="" width="169" height="244" title=""/></a></li>
		                    </#list>
		                    <div class="clear-float"></div>
		                    </ul>
		                </#list>
		            </#if>  
                    </div>
                	<div class="image-paging slides-image-nav"></div>
                </div>
                
				</div>
			</div>
			<div class="clear-float"></div>
			<div class="content-wrap">
				<form action="${contextPath}/admin/update"  method="post" id="addForm">
					<input id="id" name="id"  type="hidden" value="" size="40"/>
					<p>title:</p><input id="title" name="title"  type="text" size="150"/>
					<p>bannerurl:</p><input id="url" name="url"  type="text" size="150"/>
					<p><input  type="submit" value="提交"/>
					<input  type="button" value="应用到首页" id="apply_btn"/></p>
				</form>
				
			</div>	

	  <div style="height:50px"></div>
	
	
	 <#include "/include/footer.ftl">
</div>
</body>
<#include "/include/js.html">
<script type="text/javascript" src="${jsRoot}/admin/movie_banner/movie_banner_index.js"></script>
</body>
<script>

	function showDetail(obj){
		var id=$(obj).prev().find("#movieId").val().trim();
		var movieTitle=$(obj).prev().find("#movieTitle").val().trim();

		$("#id").val(id);
		$("#title").val(movieTitle);
	}
	
	function showTag(obj){
		$(obj).parent().prev().css("display","block");
	}

	function hideTag(obj){
		$(obj).parent().prev().css("display","none");
	}
	
	$("#apply_btn").click(function(){
		$.ajax({
		   type: "POST",
		   url: "${contextPath}/admin/deleteMoveCache",
		   success: function(msg){
		       alert(msg);
		   }
		});
	});
</script>
</html>